/**
 * 游戏流程控制
 *
 * @author li.youxi
 * @date 2017/05/25
 */

	var doc = document,

	classNameObj = {
		layer: 'game-layer'

	};

	window.gameObj = {
		status: 'index',

		//游戏状态
		setStatus: function(status, cb){
			
			if(!status) return;

			this.status = status;
			this._setLayer(status);

			if(cb) {
				cb();
			}
		},

		_setLayer: function(status){
			var ele = doc.querySelectorAll('.'+classNameObj.layer),
				curEle = doc.querySelector('#game_'+status),
				len = ele.length,
				i = 0;

			if(!curEle) return;

			for(; i<len; i++) {
				ele[i].style.display = 'none';
			}

			curEle.style.display = 'block';
		}
	};

	gameObj.setStatus('index');

